<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});



//后台路由
Route::group(['namespace'=>'Admin','prefix'=>'admin'],function(){
    Route::get('/login', 'LoginController@index');
    Route::get('/register', 'LoginController@register');
    Route::post('/register_res', 'LoginController@register_res');
    Route::post('/login_res', 'LoginController@login_res');
    Route::get('/property', 'PropertyController@index');
    Route::get('/houseadd', 'PropertyController@house_add');
    Route::post('/house_add_do', 'PropertyController@house_add_do');
    Route::get('/review', 'PropertyController@review');
    Route::post('/upload', 'PropertyController@upload');
    Route::post('/review_res', 'PropertyController@review_res');
    Route::get('/saleList', 'SaleController@saleList');//销售列表
    Route::post('/search', 'SaleController@search');//销售列表中的查询
    Route::get('/search_sale', 'SaleController@search_sale');//销售列表中的查询模板
    Route::get('/middle', 'SaleController@middle');
    Route::get('/journal', 'SaleController@journal');//销售人员日志
    Route::get('/journal_add', 'SaleController@journal_add');//销售人员日志添加页面渲染
    Route::post('/add_journal', 'SaleController@add_journal');//销售人员日志添加
    Route::get('/journal_del', 'SaleController@journal_del');//销售人员日志删除
    Route::get('/journal_update', 'SaleController@journal_update');//销售人员日志修改渲染
    Route::post('/upd_journal', 'SaleController@upd_journal');//销售人员日志修改


});

//前台路由
Route::group(['namespace'=>'Home','prefix'=>'home'],function(){

    Route::get('/login', 'LoginController@index');	//前台登陆
    Route::post('/login_do', 'LoginController@login_do');	//前台登陆
    Route::get('/clear' , 'LoginController@clear'); //前台用户退出登陆

    Route::get('/register', 'RegisterController@index');   //前台用户注册
    Route::post('/region' , 'RegisterController@region'); //前台用户注册

    Route::get('/proregister', 'ProregisterController@index');   //前台物业注册
    Route::post('/proregion', 'ProregisterController@proregion');   //前台物业注册
    
    Route::get('/prologin', 'ProloginController@index');   //前台物业登陆
    Route::post('/prologin_do', 'ProloginController@prologin_do');   //前台物业登陆

    Route::get('/index', 'IndexController@index');  //前台首页

});

//超管
Route::group(['namespace'=>'Index','prefix'=>'index'],function(){

    Route::get('/login', 'IndexController@login');
    Route::any('/do_login', 'IndexController@do_login');
    Route::any('/logout', 'IndexController@logout');
    Route::get('/list', 'IndexController@list');
    Route::get('/introduce', 'IndexController@introduce');
    Route::post('/intro_do', 'IndexController@intro_do');
    Route::post('/del_do', 'IndexController@del_do');
    Route::any('/add', 'IndexController@add');
    Route::post('/add_do', 'IndexController@add_do');
    route::get('/upd','IndexController@upd');


    Route::get('/house', 'IndexController@house');
    Route::get('/houseadd', 'IndexController@houseadd');
    Route::get('/review', 'IndexController@review');

    Route::get('/saleList', 'IndexController@saleList');//销售列表
});